/**
 * 相当于固定两个点，在凸多边形上移动一个点求最大三角形
 * 显然具有单峰，可以使用三分搜索
 * 注意整数下标的三分搜索实现
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using Real = double;
using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;

struct Point{
    llt x;
    llt y;
};

llt cross(const Point & O, const Point & A, const Point & B){
    llt xoa = A.x - O.x, yoa = A.y - O.y;
    llt xob = B.x - O.x, yob = B.y - O.y;
    return xoa * yob - xob * yoa;
}

int N, K;
vector<Point> Con;

llt ternary(int left, int right){
    const auto & P = Con[left];
    const auto & Q = Con[right];
    llt ans = 0;
    if(right  < left) right += N;
    int m1, m2;
    do{
        m1 = (left + left + right) / 3;
        m2 = (left + right + right) / 3; 
        auto c1 = cross(P, Con[m1%N], Q);
        auto c2 = cross(P, Con[m2%N], Q);
        if(c1 >= c2) right = m2, ans = max(ans, c1);
        else left = m1, ans = max(ans, c2);
    }while(left + 2 < right);
    for(int i=left;i<=right;++i) ans = max(ans, cross(P, Con[i%N], Q));
    return ans;
}

llt proc(){
    llt level = 0;
    for(int i=1;i+1<=K;++i){
        level += cross(Con[0], Con[i], Con[i+1]);
    }

    llt ans = 0;
    for(int b=0,c=K;b<N;++b,c=(c+1)%N){
        const auto & pb = Con[b];
        const auto & pc = Con[c];
        ans = max(ans, level + ternary(c, b));
        level += cross(pb, pc, Con[(c+1)%N]);
        level -= cross(pb, Con[(b+1)%N], Con[(c+1)%N]);
    }

    return ans;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofakse = 1;
    cin >> nofakse;
    while(nofakse--){
        cin >> N >> K;
        Con.assign(N, {});
        for(auto & p : Con){
            int x, y; cin >> x >> y;
            p.x = x; p.y = y;
        }
        auto ans = proc();
        cout << ans / 2;
        if(ans & 1) cout << ".5";
        cout << "\n";
    }
    return 0;
}